﻿using LimaLims.Application.Service.Base.Dto;
using LimaLims.Core;
using LimaLims.Core.Enum;
using LimaLims.Core.Util;

namespace LimaLims.Application.Service.TestCenter.Dto
{
    /// <summary>
    /// 绝缘电阻试验
    /// </summary>
    public class InsulationResistanceOutput : BaseDto
    {
        /// <summary>
        /// 出厂编号
        /// </summary>
        public string FactoryNumbe { get; set; }
        /// <summary>
        /// 设备Id
        /// </summary>
        public long EquipmentInfoId { get; set; }
        /// <summary>
        /// 设备编号
        /// </summary>
        public string EquipmentCode { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string EquipmentName { get; set; }

        /// <summary>
        /// 试验任务ID
        /// </summary>
        public long? ExperimentTaskId { get; set; }

        /// <summary>
        /// 试验任务编号
        /// </summary>
        public string ExperimentTaskCode { get; set; }
        /// <summary>
        /// 环境温度
        /// </summary>
        public float? AmbientTemperature { get; set; }

        /// <summary>
        /// 环境湿度
        /// </summary>
        public float? AmbientHumidity { get; set; }

        /// <summary>
        /// 试验类型（绝缘电阻、吸收比、极化指数、DC测试、AC测试、步进电压测试）
        /// </summary>
        public string TestType { get; set; }

        /// <summary>
        /// 测试部位（高压-中压、低压及地、中压-高压、低压及地、低压-高压、中压及地、高压中压-低压及地、高压、中压、低压-地、高压-中压、中压-低压）
        /// </summary>
        public string Position { get; set; }

        /// <summary>
        /// 试验电压
        /// </summary>
        public float? TestVoltage { get; set; }

        /// <summary>
        /// 吸收比
        /// </summary>
        public float? AbsorptionRatio { get; set; }

        /// <summary>
        /// R15
        /// </summary>
        public float? R15 { get; set; }

        /// <summary>
        /// R60
        /// </summary>
        public float? R60 { get; set; }

        /// <summary>
        /// 试验结果
        /// </summary>
        public ExperimentResult? Result { get; set; }

        /// <summary>
        /// 试验结果Text
        /// </summary>
        public string ResultText => Result.HasValue ? Result.GetDescription() : "";
    }

    /// <summary>
    /// 绝缘电阻试验分页查询
    /// </summary>
    public class InsulationResistancePageInput : PageInputBase
    {
        /// <summary>
        /// 任务编号
        /// </summary>
        public string ExperimentTaskCode { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        public string EquipmentCode { get; set; }
        /// <summary>
        /// 出厂编号
        /// </summary>
        public string FactoryNumbe { get; set; }
    }
}
